Skip to main content

Migration Guide from LevelPlay to XMediatorAds

Integration

This section helps you migrate from the LevelPlay to the XMediatorAds in your iOS projects.


Initialize the SDK Comparison

OperationLevelPlayXMediator
Set User IDLPMInitRequestBuilder(appKey: "appKey").withUserId("user-id")UserProperties(userId: "user-id")
Set Test Mode(Not available)InitSettings(test: true)
Set Extra ParamsInitSettings(userProperties: UserProperties(customProperties: ...))
SDK InitializationLevelPlay.initWith(initRequest) { config, error in ... }XMediatorAds.startWith(appKey: "appKey", initSettings: settings) { result in ... }

For more details, refer to:


Ad Formats

OperationLevelPlayXMediator
Create Bannerlet banner = LPMBannerAdView(addUnitId: "addUnitId", config: adConfig)XMediatorAds.banner.create(placementId: "placementId", size: .phone, viewController: self)
Set Delegatebanner.delegate = selfXMediatorAds.banner.addDelegate(self)
Load Bannerbanner.loadAd(with: self)(Auto-loaded on create)
Show BanneraddSubview(banner)addSubview(bannerView)
Destroy/Removebanner.destroy()

Delegate Method Comparison

Event / ActionLevelPlay (LPMBannerAdViewDelegate)XMediator (BannerAdsDelegate)
Banner Loadedfunc didLoadAd(with adInfo: LPMAdInfo)func didLoad(placementId: String, result: LoadResult)
Failed to Loadfunc didFailToLoadAd(withAdUnitId adUnitId: String, error: Error)Not exposed — handled internally
Clickedfunc didClickAd(with adInfo: LPMAdInfo)func didClick(placementId: String)
Impression RecordedNot available by defaultfunc didRecordImpression(placementId: String, data: ImpressionData)

Key Differences: Banner Ads

FeatureLevelPlayXMediator
Banner CreationLPMBannerAdViewXMediatorAds.banner.create
Banner SizesPhone, Tablet, Mrec, AdaptivePhone, Tablet, Mrec
Show BannerAdd view to containerAdd view to container
Impression CallbackNot available by defaultExplicit callback per placement
Delegate ProtocolLPMBannerAdViewDelegateBannerAdsDelegate
Ad IdentifiersPlacement NamePlacement ID
Retry LogicManualAutomatic (SDK handles retries)

For more details, refer to: X3M Banner LevelPlay Banner


Interstitial Ads

Interstitial API Method Comparison

OperationLevelPlayXMediator
Create Interstitiallet interstitialAd = LPMInterstitialAd(adUnitId: "adUnitId")(Auto-managed by SDK, no explicit object)
Set DelegateinterstitialAd.delegate = selfXMediatorAds.interstitial.addDelegate(self)
Load InterstitialinterstitialAd.loadAd()XMediatorAds.interstitial.load(placementId: "...")
Check ReadyinterstitialAd.isReady()XMediatorAds.interstitial.isReady(withPlacementId: ...)
Show InterstitialinterstitialAd.show(viewController: viewController, placementName: nil)XMediatorAds.interstitial.present(fromViewController: self, fromAdSpace: "interstitial-ad-space")

Delegate Method Comparison

Event / ActionLevelPlay (LPMInterstitialAdDelegate)XMediator (InterstitialAdsDelegate)
Loadedfunc didLoadAd(with adInfo: LPMAdInfo)func didLoad(placementId: String, result: LoadResult)
Failed to Loadfunc didFailToLoadAd(withAdUnitId adUnitId: String, error: Error)Not exposed — handled internally
Presentedfunc didDisplayAd(with adInfo: LPMAdInfo)func didPresent(placementId: String)
Failed to Presentfunc didFailToDisplayAd(with adInfo: LPMAdInfo, error: Error)func failedToPresent(placementId: String, error: PresentError)
Impression Recordedfunc didRecordImpression(placementId: String, data: ImpressionData)
Will Dismissfunc willDismiss(placementId: String)
Closed/Dismissedfunc didCloseAd(with adInfo: LPMAdInfo)func didDismiss(placementId: String)
Clickedfunc didClickAd(with adInfo: LPMAdInfo)func didClick(placementId: String)

Key Differences: Interstitial Ads

FeatureLevelPlay (LPMInterstitialAd)XMediator (InterstitialAdsDelegate)
Ad ObjectExplicit (LPMInterstitialAd)Auto-managed (no explicit object)
Delegate ProtocolLPMInterstitialAdDelegateInterstitialAdsDelegate
Ad IdentifiersAd Unit IDPlacement ID
Load/ShowPerformed on explicit objectStatic call on SDK
Impression CallbackOn displayExplicit callback per placement
Retry LogicManualAutomatic (SDK handles retries)
Error HandlingDelegate methods with NSError/ErrorDelegate methods with error objects

For more details, refer to: X3M Interstitial LevelPlay Interstitial


Rewarded Ads

Rewarded API Method Comparison

OperationLevelPlayXMediator
Create RewardedLPMRewardedVideoAd.createWithPlacementId("...")Not required - singleton via XMediatorAds.rewarded
Set DelegaterewardedAd.setDelegate(self)XMediatorAds.rewarded.addDelegate(self)
Load RewardedrewardedAd.loadAd()XMediatorAds.rewarded.load(placementId: "...")
Check ReadyrewardedAd.isAdReady()XMediatorAds.rewarded.isReady() or XMediatorAds.rewarded.isReady(withPlacementId: ...)
Show RewardedrewardedAd.showAd(viewController: self, placementName: nil)XMediatorAds.rewarded.present(fromViewController: self, fromAdSpace: "rewarded-ad-space")

Delegate Method Comparison

Event / ActionLevelPlay (LPMRewardedAdDelegate)XMediator (RewardedAdsDelegate)
Loadedfunc didLoadAd(with adInfo: LPMAdInfo)func didLoad(placementId: String, result: LoadResult)
Failed to Loadfunc didFailToLoadAd(withAdUnitId adUnitId: String, error: Error)Not exposed — handled internally
Displayedfunc didDisplayAd(with adInfo: LPMAdInfo)func didPresent(placementId: String)
Failed to Presentfunc didFailToDisplayAd(with adInfo: LPMAdInfo, error: Error)func failedToPresent(placementId: String, error: PresentError)
Clickedfunc didClickAd(with adInfo: LPMAdInfo)func didClick(placementId: String)
Closed/Dismissedfunc didCloseAd(with adInfo: LPMAdInfo)func didDismiss(placementId: String)
Will Dismissfunc willDismiss(placementId: String)
Impression/Revenuefunc didRecordImpression(placementId: String, data: ImpressionData)
Rewardedfunc didRewardAd(with adInfo: LPMAdInfo, reward: LPMReward)func didEarnReward(placementId: String)

Key Differences: Rewarded Ads

FeatureLevelPlayXMediator
Reward CallbackdidReceiveRewarddidEarnReward
Impression CallbackOn displayExplicit callback per placement
Delegate ProtocolISDemandOnlyRewardedVideoDelegateRewardedAdsDelegate
Ad IdentifiersInstance IDPlacement ID
Retry LogicManualAutomatic (SDK handles retries)
Auto-load/Auto-retryManualAutomatic after dismiss/fail

For more details, refer to: X3M Rewarded LevelPlay Rewarded